package com.kjlink.internal.workreport.report.mapper;

import cn.xuqiudong.common.base.mapper.BaseMapper;
import com.kjlink.internal.report4vue.statictics.response.ApiReportSummary;
import com.kjlink.internal.workreport.report.model.WorkReport;
import com.kjlink.internal.workreport.stats.lookup.UserWeekLookup;
import com.kjlink.internal.workreport.stats.vo.UserReportTimeVo;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

/**
 * 功能: : Mapper
 *
 * @author Vic.xu
 * @since 2024-04-29 13:37
 */
public interface WorkReportMapper extends BaseMapper<WorkReport> {

    List<WorkReport> sameDayReport(@Param("id") Integer id);

    List<WorkReport> getDayReportByDate(@Param("userId") Integer userId, @Param("date") LocalDate date);

    /**
     * 查看项目的总工时
     *
     * @param projectId 项目id
     */
    Integer totalTime(@Param("projectId") Integer projectId);

    Integer yearTime(@Param("projectId") Integer projectId, @Param("year") int year);


    Integer monthTime(@Param("projectId") Integer projectId, @Param("year") int year, @Param("month") int month);

    List<UserReportTimeVo> weekTimeStats(UserWeekLookup lookup);

    ApiReportSummary summary();

    int totalWorkReport(@Param("projectId") int projectId);
}
